﻿@model List<smartcrm.Department>

<script src="../../Scripts/department.js"></script>

<div class="FR">
<input type="button" value="新增" id="btnNew" />
</div>
<div class="list">
<table id="tDepartment">
<thead>
<tr>
<th style="width:15%">名称</th>
<th>描述</th>
<th style="width:10%">参与订单流程</th>
<th style="width:6%">操作</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
        {
            <tr>
                <td>@Html.DisplayFor(modelItem => item.DepartmentName   )</td>
                <td>@Html.DisplayFor(modelItem => item.DepartmentDescription)</td>                
                <td>
                @if (item.Participate)
                {
                    <span>☑</span>
                }
                else
                {
                   <span>☐</span>
                }
                
                </td>                       
                <td>
                    <img src="../../Images/grid/edit.png" title="编辑" onclick="javascript:EditDepartment('@item.DepartmentNo')" />
                    <img src="../../Images/grid/delete.png" title="删除"  onclick="javascript:DeleteDepartment('@item.DepartmentNo')" /> 
                </td>
            </tr>
        }
</tbody>
</table>
</div>

<div id="divDepartment" title="部门信息" style="display:none">      
    <div id="divDepartmentContent" style="overflow-y: auto; height: 230px;">          
        @using (Html.BeginForm())
        {
            <table id="tableEdit" class="font85 tableEdit">            
                <tr>
                    <td class="label">部门名称</td>
                    <td>
                        @Html.TextBox("DepartmentName", null, new { maxlength = "50" })&nbsp;<span class="redStar">*</span>                                           
                    </td>
                </tr>
                <tr>
                    <td class="label">参与订单流程</td>
                    <td>
                        @Html.CheckBox("Participate")
                     </td>
                </tr>  
                <tr>
                    <td class="label">部门描述</td>
                    <td>
                        @Html.TextArea("DepartmentDescription", null, new { maxlength = "50" })                       
                     </td>
                </tr>                                       
            </table> 
            <br />            
            @Html.Hidden("DepartmentNo")
        }
    </div>  
    <div style="text-align:right;">  
       <span id="errorMessage" class="errorSpan"></span>        
       <input type="button" id="btnSave" value="保存" />
       <input type="button" id="btnCancel" value="取消" />    
    </div>  
</div>  
